package cn.com.lookang.robot.entity;

import lombok.*;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;

/**
 * @author liulekang
 * @date 2020/7/30
 */
@Data
@Entity
@Builder
@ToString
@AllArgsConstructor
@NoArgsConstructor
@javax.persistence.Table(name = "play_realm")
public class PlayRealmEntity {
    private String id;
    private String realmName;
    private String rootPlayerName;
    private String rootPlayerQq;
    private Date playDate;
    private Integer playerNum;

    @javax.persistence.Id
    @javax.persistence.Column(name = "id")
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @javax.persistence.Basic
    @javax.persistence.Column(name = "realm_name")
    public String getRealmName() {
        return realmName;
    }

    public void setRealmName(String realmName) {
        this.realmName = realmName;
    }

    @javax.persistence.Basic
    @javax.persistence.Column(name = "root_player_name")
    public String getRootPlayerName() {
        return rootPlayerName;
    }

    public void setRootPlayerName(String rootPlayerName) {
        this.rootPlayerName = rootPlayerName;
    }

    @javax.persistence.Basic
    @javax.persistence.Column(name = "root_player_qq")
    public String getRootPlayerQq() {
        return rootPlayerQq;
    }

    public void setRootPlayerQq(String rootPlayerQq) {
        this.rootPlayerQq = rootPlayerQq;
    }

    @javax.persistence.Basic
    @javax.persistence.Column(name = "play_date")
    public Date getPlayDate() {
        return playDate;
    }

    public void setPlayDate(Date playDate) {
        this.playDate = playDate;
    }

    @javax.persistence.Basic
    @javax.persistence.Column(name = "player_num")
    public Integer getPlayerNum() {
        return playerNum;
    }

    public void setPlayerNum(Integer playerNum) {
        this.playerNum = playerNum;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PlayRealmEntity that = (PlayRealmEntity) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(realmName, that.realmName) &&
                Objects.equals(rootPlayerName, that.rootPlayerName) &&
                Objects.equals(rootPlayerQq, that.rootPlayerQq) &&
                Objects.equals(playDate, that.playDate) &&
                Objects.equals(playerNum, that.playerNum);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, realmName, rootPlayerName, rootPlayerQq, playDate, playerNum);
    }
}
